package org.tea.inventory.enums;

import lombok.Getter;
import lombok.Setter;

/**
 * @author hanzy
 * @description 客户表彰 类别
 * @date 2023年04月06日 14:03
 */
public enum CustomerTrewardCategoryEnum {
    One("10", "一类表彰", 30000L),
    Two("20", "二类表彰", 10000L),
    Other("30", "其他表彰", 3000L),

    ;

    @Getter
    @Setter
    private String code;
    @Getter
    @Setter
    private String content;

    @Getter
    @Setter
    private Long num;

    CustomerTrewardCategoryEnum(String code, String content, Long num) {
        this.code = code;
        this.content = content;
        this.num = num;
    }

    public static String getContentByName(String code) {
        for (CustomerTrewardCategoryEnum categoryEnum : CustomerTrewardCategoryEnum.values()) {
            if (categoryEnum.getCode().equals(code)) {
                return categoryEnum.getContent();
            }
        }
        return "";
    }

    public static Long getNumByName(String code) {
        for (CustomerTrewardCategoryEnum categoryEnum : CustomerTrewardCategoryEnum.values()) {
            if (categoryEnum.getCode().equals(code)) {
                return categoryEnum.getNum();
            }
        }
        return 0L;
    }
}
